In [1]:
'''Plot CoStar, Corelogic Examples Paper 2
Sean McCulloch 4/10/20'''

import os
import pandas as pd
import geopandas as gpd
import pyproj
from pyproj import Proj, transform
import shapely
from shapely.geometry import Point, Polygon
from shapely import wkt
from shapely.ops import transform
from descartes import PolygonPatch
from functools import partial
import matplotlib.pyplot as plt
import matplotlib.cm as cmx
import matplotlib.colors as colors

os.chdir('Y:\housing_regulation\gis\code')
proj_wgs84 = pyproj.Proj(init='epsg:4326')
In [2]:
def create_city_center(cbsa):
    cbsa_coord_df = pd.read_stata('./city_center_coords.dta')
    cbsa_coord_df['cbsacode'] = cbsa_coord_df['cbsacode'].apply(str)
    cbsa_coord_df = cbsa_coord_df[cbsa_coord_df['cbsacode'] == cbsa]
    cbsa_coord_df = cbsa_coord_df.reset_index(drop=True)

    return cbsa_coord_df
In [3]:
def create_county_df():
    counties_df = gpd.read_file('../shapefile/tl_2016_us_county.shp')
    counties_df['STATE_COUNTY'] = counties_df.apply(lambda x: str(x['STATEFP']) + '_' + str(x['COUNTYFP']), axis = 1)
    return counties_df
In [4]:
def create_county_list(cbsa):
    counties = pd.read_csv('./countylist.txt', sep = '\t', header = None)
    counties = counties.rename(columns = {0: 'countycode', 2: 'CBSAFP', 5: 'countyname'})
    counties['CBSAFP'] = counties['CBSAFP'].apply(str)
    counties['countycode'] = counties['countycode'].apply(str)
    counties['STATE_COUNTY'] = counties.apply(lambda x: x['countycode'][0:2] + '_' + x['countycode'][-3:] if len(x['countycode']) == 5
                                                           else '0' + x['countycode'][0:1] + '_' + x['countycode'][-3:], axis = 1)
    counties = counties[['STATE_COUNTY', 'CBSAFP', 'countyname']]
    counties = counties[counties['CBSAFP'] == cbsa]
    counties = list(counties.sort_values('countyname')['STATE_COUNTY'])
    return counties
In [5]:
def create_county_name_list(cbsa):
    counties = pd.read_csv('./countylist.txt', sep = '\t', header = None)
    counties = counties.rename(columns = {0: 'countycode', 2: 'CBSAFP', 5: 'countyname'})
    counties['CBSAFP'] = counties['CBSAFP'].apply(str)
    counties['countycode'] = counties['countycode'].apply(str)
    counties['STATE_COUNTY'] = counties.apply(lambda x: x['countycode'][0:2] + '_' + x['countycode'][-3:] if len(x['countycode']) == 5
                                                           else '0' + x['countycode'][0:1] + '_' + x['countycode'][-3:], axis = 1)
    counties = counties[['STATE_COUNTY', 'CBSAFP', 'countyname']]
    counties = counties[counties['CBSAFP'] == cbsa]
    countynames = list(counties.sort_values('countyname')['countyname'])
    counties = list(counties.sort_values('countyname')['STATE_COUNTY'])
    return counties, countynames
In [6]:
def create_cbsa_counties_df(counties_df, counties):
    counties_df['tokeep'] = counties_df.apply(lambda x: x['STATE_COUNTY'] in counties, axis = 1)
    counties_df = counties_df[counties_df['tokeep'] == True]
    return counties_df
In [7]:
def create_cbsas(cbsa):
    cbsa_df = gpd.read_file('../shapefile/tl_2017_us_cbsa.shp')
    cbsa_df = cbsa_df[cbsa_df['CBSAFP'] == cbsa]
    return cbsa_df
In [8]:
#This method plots a ring of points x distance from lat, lon and then makes an ellipse.
def geodesic_point_buffer(lat, lon, km):
    # Azimuthal equidistant projection
    aeqd_proj = '+proj=aeqd +lat_0={lat} +lon_0={lon} +x_0=0 +y_0=0'
    project = partial(
        pyproj.transform,
        pyproj.Proj(aeqd_proj.format(lat=lat, lon=lon)),
        proj_wgs84)
    buf = Point(0, 0).buffer(km * 1000)  # distance in meters
    return shapely.ops.transform(project, buf) #.exterior.coords[:]
In [9]:
def plot_by_cbsa_circle(points, cbsa, national_counties_df, pos = 'best'):
    cbsa_df  = create_cbsas(cbsa)
    counties = create_county_list(cbsa)
    city_center = create_city_center(cbsa)

    base = create_cbsa_counties_df(national_counties_df, counties)
    cbsabase = cbsa_df
    
    if cbsa == "35620":
        f, ax = plt.subplots(1, figsize=(62, 75))
    else:
        f, ax = plt.subplots(1, figsize=(28, 34))
    ax.set_axis_off()
    plt.axis('equal')

    ax = cbsabase.plot(ax=ax, color='None', edgecolor='black', zorder = 20)
    ax = base.plot(ax=ax, color='None', edgecolor='black', zorder = 30)

    for county in counties:
        county_center = base[base['STATE_COUNTY'] == county]
        state_str, county_str = state_str, county_str = county.split('_')[0], county.split('_')[1]
        try:
            water_gdf = gpd.read_file('../shapefile/water/tl_2016_{}{}_areawater.shp'.format(state_str, county_str))
            ax = water_gdf.plot(ax = ax, color = 'blue', alpha=1)
        except:
            pass

        countyname = county_center['NAMELSAD'].iloc[-1]
        county_centroid =  county_center['geometry'].centroid
        county_labels = '{}'.format(countyname)
        gpd.GeoSeries(county_centroid).plot(ax = ax, marker= 'o', color = 'black', alpha=0, label = county_labels, markersize=50)
        plt.text(county_centroid.x.tolist()[0], county_centroid.y.tolist()[0],
        county_labels, size=15, rotation=-0.1, ha="right", va="top", zorder=50)

    city_center_df = create_city_center(cbsa)
    y_coord = city_center_df.iloc[0]['cbsa_longitude']
    x_coord = city_center_df.iloc[0]['cbsa_latitude']
    y_coord = float(y_coord)
    x_coord = float(x_coord)

   
    #Try plotting circle with point buffer rather than artist. Ellipsoids
    km = 48.2803 # 48.2803 km ~ 30 miles
    circle_points = geodesic_point_buffer(x_coord, y_coord, km)
    circle_points_patch2 = PolygonPatch(circle_points, facecolor='None',
    edgecolor= 'green', linewidth=3)
    ax.add_patch(circle_points_patch2)
    
    #Now add whatever points are being plotted.
    x_values = points['latitude'].tolist()
    y_values = points['longitude'].tolist()
    
    #Scale the size of dots by number of observations
    if points.shape[0] == 0:
        print('No Points to Plot')
        scalar = 22
    elif points.shape[0] == 1:
        scalar = 22
    else:
        scalar = 22 / (points.shape[0] / 100)
    plt.scatter(y_values, x_values, color='red', s=scalar, zorder=20)
    
    plt.show()
In [10]:
def plot_3maps(point_df, cbsa):
    #Load in data
    county = str(int(point_df['county'].iloc[0]))
    q_points = pd.read_stata(r'Z:\data\paper2_casestudy\corelogic_counties_q\qcoords_'
                             + county + '.dta')
    q_points = q_points.rename(columns={'blocklevellongitude':'longitude',
                                          'blocklevellatitude':'latitude'})
    A_points = pd.read_stata(r'Z:\data\paper2_casestudy\corelogic_counties_A\Acoords_'
                             + county + '.dta')
    A_points = A_points.rename(columns={'blocklevellongitude':'longitude',
                                          'blocklevellatitude':'latitude'})
    q_nobs = str(int(q_points.shape[0]))
    A_nobs = str(int(A_points.shape[0]))

    print('CoStar Info:')
    print(point_df.iloc[0])
    print("-------------------")
    print("Location of CoStar Sale:")
    plot_by_cbsa_circle(point_df, str(cbsa), national_counties_df, 'best')
    
    print("Locations of Hedonic q Corelogic Observations (Nobs:" + q_nobs + "):")
    plot_by_cbsa_circle(q_points, str(cbsa), national_counties_df, 'best')

    print("Locations of New Housing A Corelogic Observations (Nobs:" + A_nobs + "):")
    plot_by_cbsa_circle(A_points, str(cbsa), national_counties_df, 'best')
In [11]:
national_counties_df = create_county_df()
In [12]:
#Plot Costar Point
costar_df = pd.read_stata(r'Z:\data\paper2_casestudy\costar_descN.dta')
In [13]:
cbsas = [41860, 12060, 42660, 31080, 35620, 19100]

for c in cbsas:
    points_df = costar_df[costar_df['cbsa'] == c]
    cbsaname =  points_df['cbsaname'].iloc[0]
    medz = points_df['med_z_qac'].iloc[0]
    #Only take 6 obs closest to median
    points_df = points_df.iloc[(points_df['z_perquartac']-medz).abs().argsort()[:6]]
    #Limit to central observations
    #length = points_df.shape[0]
    #if length >= 8:
        #points_df = points_df.iloc[round(length/2)-3 : round(length/2)+3]
    print("CBSA: "+ cbsaname + ", 6 Central Obs with N Comment")
    for i in range(points_df.shape[0]):
        print("Example " + str(i + 1))
        point_df = points_df.iloc[[i]]
        plot_3maps(point_df, c)
        print("-------------------------------------------------------------------------------")
CBSA: San Francisco-Oakland-Hayward, CA, 6 Central Obs with N Comment
Example 1
CoStar Info:
cbsaname                                   San Francisco-Oakland-Hayward, CA
countyname                                                           Alameda
z_perhouse                                                            212911
z_perquartac                                                          519417
saleprice_real                                                   2.12157e+08
land_sqft                                                            7975473
N_county                                                                 806
N_new                                                                    806
mean_lotsize_county                                                  4463.85
int_margins_sqft_county                                              11.2709
cbsa                                                                   41860
county                                                                  6001
compid                                                               3207172
propertyaddress                                            6582 Tassajara Rd
buyertruecompany                                               Castlelake LP
sellertruecompany                                   Charter Properties, Inc.
propertycity                                                          Dublin
all_desc_text              Wallis Ranch consists of approximately184 acre...
longitude                                                           -121.875
latitude                                                             37.7355
med_z_qac                                                             357526
Name: 565, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:46316):
Locations of New Housing A Corelogic Observations (Nobs:1431):
-------------------------------------------------------------------------------
Example 2
CoStar Info:
cbsaname                   San Francisco-Oakland-Hayward, CA
countyname                                             Marin
z_perhouse                                            682154
z_perquartac                                          537580
saleprice_real                                   9.70131e+06
land_sqft                                             171388
N_county                                                  12
N_new                                                     12
mean_lotsize_county                                  13818.7
int_margins_sqft_county                              9.13897
cbsa                                                   41860
county                                                  6041
compid                                               2745381
propertyaddress                                  Trinidad Dr
buyertruecompany                     Bekirk Enterprises, LLC
sellertruecompany              RBC Real Estate Finance, Inc.
propertycity                                         Tiburon
all_desc_text                                Tiburon 12 Lots
longitude                                           -122.479
latitude                                              37.914
med_z_qac                                             357526
Name: 567, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:12506):
Locations of New Housing A Corelogic Observations (Nobs:151):
-------------------------------------------------------------------------------
Example 3
CoStar Info:
cbsaname                   San Francisco-Oakland-Hayward, CA
countyname                                      Contra Costa
z_perhouse                                            102620
z_perquartac                                          117250
saleprice_real                                   1.11383e+06
land_sqft                                             106722
N_county                                                   5
N_new                                                      5
mean_lotsize_county                                  9531.19
int_margins_sqft_county                              12.6055
cbsa                                                   41860
county                                                  6013
compid                                               3087315
propertyaddress                           1039 Ridge Park Dr
buyertruecompany                     Koart Residential, Inc.
sellertruecompany                          Kunz Family Trust
propertycity                                         Concord
all_desc_text                       Unique 5 Lot Opportunity
longitude                                           -122.018
latitude                                             37.9626
med_z_qac                                             357526
Name: 563, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:50969):
Locations of New Housing A Corelogic Observations (Nobs:1654):
-------------------------------------------------------------------------------
Example 4
CoStar Info:
cbsaname                        San Francisco-Oakland-Hayward, CA
countyname                                           Contra Costa
z_perhouse                                                 527222
z_perquartac                                               602385
saleprice_real                                        2.58947e+07
land_sqft                                                  879557
N_county                                                       40
N_new                                                          40
mean_lotsize_county                                       9531.19
int_margins_sqft_county                                   12.6055
cbsa                                                        41860
county                                                       6013
compid                                                    3501572
propertyaddress                                        Tomcat Way
buyertruecompany                                    Davidon Homes
sellertruecompany                Farallon Capital Management, LLC
propertycity                                               Orinda
all_desc_text               Davidon Homes at Wilder (40 SFR Lots)
longitude                                                -122.187
latitude                                                  37.8623
med_z_qac                                                  357526
Name: 571, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:50969):
Locations of New Housing A Corelogic Observations (Nobs:1654):
-------------------------------------------------------------------------------
Example 5
CoStar Info:
cbsaname                                   San Francisco-Oakland-Hayward, CA
countyname                                                             Marin
z_perhouse                                                           79975.4
z_perquartac                                                         63025.6
saleprice_real                                                   1.85638e+06
land_sqft                                                            4312440
N_county                                                                   9
N_new                                                                      9
mean_lotsize_county                                                  13818.7
int_margins_sqft_county                                              9.13897
cbsa                                                                   41860
county                                                                  6041
compid                                                               2947063
propertyaddress                    Sir Francis Drake Blvd & Ln @ Oak Tree Ln
buyertruecompany                                             Marshal Rothman
sellertruecompany                                    Bay Pacific Corporation
propertycity                                                         Fairfax
all_desc_text              The property consists of approximately 99 acre...
longitude                                                           -122.591
latitude                                                             37.9955
med_z_qac                                                             357526
Name: 570, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:12506):
Locations of New Housing A Corelogic Observations (Nobs:151):
-------------------------------------------------------------------------------
Example 6
CoStar Info:
cbsaname                     San Francisco-Oakland-Hayward, CA
countyname                                           San Mateo
z_perhouse                                             46995.5
z_perquartac                                           62254.9
saleprice_real                                          819483
land_sqft                                                12402
N_county                                                     3
N_new                                                        3
mean_lotsize_county                                    8220.75
int_margins_sqft_county                                27.5116
cbsa                                                     41860
county                                                    6081
compid                                                 3946606
propertyaddress                                   Magellan Ave
buyertruecompany                                              
sellertruecompany                                             
propertycity                                     Half Moon Bay
all_desc_text               3 Lots in Miramar-Half Moon Bay CA
longitude                                             -122.462
latitude                                               37.4965
med_z_qac                                               357526
Name: 569, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:24499):
Locations of New Housing A Corelogic Observations (Nobs:400):
-------------------------------------------------------------------------------
CBSA: Atlanta-Sandy Springs-Roswell, GA, 6 Central Obs with N Comment
Example 1
CoStar Info:
cbsaname                                   Atlanta-Sandy Springs-Roswell, GA
countyname                                                            Fulton
z_perhouse                                                           18184.7
z_perquartac                                                         15794.8
saleprice_real                                                        849900
land_sqft                                                             112080
N_county                                                                  21
N_new                                                                     21
mean_lotsize_county                                                  12537.7
int_margins_sqft_county                                              1.77758
cbsa                                                                   12060
county                                                                 13121
compid                                                               4479454
propertyaddress                                             2862 Lenox Rd NE
buyertruecompany                                            Indumathi Ramesh
sellertruecompany                                        Solid Source Realty
propertycity                                                         Atlanta
all_desc_text              Prime Buckhead location. Zoned PDH- City of At...
longitude                                                           -84.3569
latitude                                                             33.8326
med_z_qac                                                            15733.3
Name: 25, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:86832):
Locations of New Housing A Corelogic Observations (Nobs:7619):
-------------------------------------------------------------------------------
Example 2
CoStar Info:
cbsaname                                   Atlanta-Sandy Springs-Roswell, GA
countyname                                                            DeKalb
z_perhouse                                                           11334.9
z_perquartac                                                         14304.5
saleprice_real                                                       99707.9
land_sqft                                                             301435
N_county                                                                  20
N_new                                                                     20
mean_lotsize_county                                                  8629.28
int_margins_sqft_county                                            -0.735811
cbsa                                                                   12060
county                                                                 13089
compid                                                               2771978
propertyaddress                                               2123 Tilson Rd
buyertruecompany                                                            
sellertruecompany                                                           
propertycity                                                         Decatur
all_desc_text              6.92 acres.  Currently zoned R-A5, the site is...
longitude                                                           -84.3043
latitude                                                              33.719
med_z_qac                                                            15733.3
Name: 17, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:55663):
Locations of New Housing A Corelogic Observations (Nobs:3222):
-------------------------------------------------------------------------------
Example 3
CoStar Info:
cbsaname                                   Atlanta-Sandy Springs-Roswell, GA
countyname                                                          Paulding
z_perhouse                                                           12081.8
z_perquartac                                                         11202.5
saleprice_real                                                   1.14565e+06
land_sqft                                                            3074465
N_county                                                                 120
N_new                                                                    120
mean_lotsize_county                                                  11744.8
int_margins_sqft_county                                            -0.215813
cbsa                                                                   12060
county                                                                 13223
compid                                                               2941981
propertyaddress                       Old Burnt Hickory Rd @ Hickory Lake Dr
buyertruecompany                                         Pacific Group, Inc.
sellertruecompany              Willoughby & Sewell Development Company, Inc.
propertycity                                                         Acworth
all_desc_text              70.58 acre, undeveloped property, wooded, gent...
longitude                                                            -84.741
latitude                                                             33.9981
med_z_qac                                                            15733.3
Name: 15, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:14516):
Locations of New Housing A Corelogic Observations (Nobs:1565):
-------------------------------------------------------------------------------
Example 4
CoStar Info:
cbsaname                                   Atlanta-Sandy Springs-Roswell, GA
countyname                                                            Fulton
z_perhouse                                                           12713.2
z_perquartac                                                         11042.4
saleprice_real                                                        735000
land_sqft                                                             112080
N_county                                                                  21
N_new                                                                     21
mean_lotsize_county                                                  12537.7
int_margins_sqft_county                                              1.77758
cbsa                                                                   12060
county                                                                 13121
compid                                                               4602510
propertyaddress                                             2862 Lenox Rd NE
buyertruecompany                                                            
sellertruecompany                                                           
propertycity                                                         Atlanta
all_desc_text              Prime Buckhead location. Zoned PDH- City of At...
longitude                                                           -84.3569
latitude                                                             33.8326
med_z_qac                                                            15733.3
Name: 1, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:86832):
Locations of New Housing A Corelogic Observations (Nobs:7619):
-------------------------------------------------------------------------------
Example 5
CoStar Info:
cbsaname                                   Atlanta-Sandy Springs-Roswell, GA
countyname                                                            Fulton
z_perhouse                                                           12713.2
z_perquartac                                                         11042.4
saleprice_real                                                        735000
land_sqft                                                             112080
N_county                                                                  21
N_new                                                                     21
mean_lotsize_county                                                  12537.7
int_margins_sqft_county                                              1.77758
cbsa                                                                   12060
county                                                                 13121
compid                                                               4676852
propertyaddress                                             2862 Lenox Rd NE
buyertruecompany                                                            
sellertruecompany                                                           
propertycity                                                         Atlanta
all_desc_text              Prime Buckhead location. Zoned PDH- City of At...
longitude                                                           -84.3569
latitude                                                             33.8326
med_z_qac                                                            15733.3
Name: 2, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:86832):
Locations of New Housing A Corelogic Observations (Nobs:7619):
-------------------------------------------------------------------------------
Example 6
CoStar Info:
cbsaname                                   Atlanta-Sandy Springs-Roswell, GA
countyname                                                            Fulton
z_perhouse                                                           8665.61
z_perquartac                                                         7526.76
saleprice_real                                                        650000
land_sqft                                                             112080
N_county                                                                  21
N_new                                                                     21
mean_lotsize_county                                                  12537.7
int_margins_sqft_county                                              1.77758
cbsa                                                                   12060
county                                                                 13121
compid                                                               4550764
propertyaddress                                             2862 Lenox Rd NE
buyertruecompany                                                            
sellertruecompany                                                           
propertycity                                                         Atlanta
all_desc_text              Prime Buckhead location. Zoned PDH- City of At...
longitude                                                           -84.3569
latitude                                                             33.8326
med_z_qac                                                            15733.3
Name: 14, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:86832):
Locations of New Housing A Corelogic Observations (Nobs:7619):
-------------------------------------------------------------------------------
CBSA: Seattle-Tacoma-Bellevue, WA, 6 Central Obs with N Comment
Example 1
CoStar Info:
cbsaname                        Seattle-Tacoma-Bellevue, WA
countyname                                             King
z_perhouse                                          83412.2
z_perquartac                                         148690
saleprice_real                                  1.74821e+06
land_sqft                                             65340
N_county                                                 14
N_new                                                    14
mean_lotsize_county                                 6109.08
int_margins_sqft_county                              6.7866
cbsa                                                  42660
county                                                53033
compid                                              3390544
propertyaddress                                 23rd Ave SW
buyertruecompany                          Yardarm Knot Inc.
sellertruecompany               Juniper Capital Corporation
propertycity                                        Seattle
all_desc_text               14 Lots Zoned SF 5000 1.5 Acres
longitude                                          -122.365
latitude                                            47.5642
med_z_qac                                            172542
Name: 591, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:163533):
Locations of New Housing A Corelogic Observations (Nobs:20846):
-------------------------------------------------------------------------------
Example 2
CoStar Info:
cbsaname                   Seattle-Tacoma-Bellevue, WA
countyname                                        King
z_perhouse                                     78309.4
z_perquartac                                    139594
saleprice_real                             8.62339e+06
land_sqft                                       623779
N_county                                            72
N_new                                               72
mean_lotsize_county                            6109.08
int_margins_sqft_county                         6.7866
cbsa                                             42660
county                                           53033
compid                                         2887090
propertyaddress                      12008 SE 316th St
buyertruecompany                  Weyerhaeuser Company
sellertruecompany                Sound Built Homes Inc
propertycity                                    Auburn
all_desc_text                    72 Single Family Lots
longitude                                     -122.181
latitude                                       47.3204
med_z_qac                                       172542
Name: 580, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:163533):
Locations of New Housing A Corelogic Observations (Nobs:20846):
-------------------------------------------------------------------------------
Example 3
CoStar Info:
cbsaname                                Seattle-Tacoma-Bellevue, WA
countyname                                                     King
z_perhouse                                                   115475
z_perquartac                                                 205845
saleprice_real                                          4.23725e+06
land_sqft                                                    217800
N_county                                                         27
N_new                                                            27
mean_lotsize_county                                         6109.08
int_margins_sqft_county                                      6.7866
cbsa                                                          42660
county                                                        53033
compid                                                      3579650
propertyaddress                                     2304 54th St SE
buyertruecompany                                  D.R. Horton, Inc.
sellertruecompany                                      DeNova Homes
propertycity                                                 Auburn
all_desc_text               27 Finished Lots Lakeland Hills Estates
longitude                                                    -122.2
latitude                                                    47.2609
med_z_qac                                                    172542
Name: 583, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:163533):
Locations of New Housing A Corelogic Observations (Nobs:20846):
-------------------------------------------------------------------------------
Example 4
CoStar Info:
cbsaname                                         Seattle-Tacoma-Bellevue, WA
countyname                                                         Snohomish
z_perhouse                                                            178061
z_perquartac                                                          219009
saleprice_real                                                   2.47928e+06
land_sqft                                                              55321
N_county                                                                  12
N_new                                                                     12
mean_lotsize_county                                                  8853.91
int_margins_sqft_county                                              3.22407
cbsa                                                                   42660
county                                                                 53061
compid                                                               3578986
propertyaddress                                        5012 Picnic Point Rd.
buyertruecompany                                                Chuck Crosby
sellertruecompany                                            Sundquist Homes
propertycity                                                         Edmonds
all_desc_text              Property Description: 12 SFR LOTS      Land In...
longitude                                                           -122.301
latitude                                                             47.8709
med_z_qac                                                             172542
Name: 587, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:43859):
Locations of New Housing A Corelogic Observations (Nobs:3769):
-------------------------------------------------------------------------------
Example 5
CoStar Info:
cbsaname                   Seattle-Tacoma-Bellevue, WA
countyname                                   Snohomish
z_perhouse                                      183840
z_perquartac                                    226116
saleprice_real                              1.4867e+07
land_sqft                                       348480
N_county                                            70
N_new                                               70
mean_lotsize_county                            8853.91
int_margins_sqft_county                        3.22407
cbsa                                             42660
county                                           53061
compid                                         3525976
propertyaddress               Baldwin Rd & 182nd St SE
buyertruecompany                 M.D.C. Holdings, Inc.
sellertruecompany             Element Residential Inc.
propertycity                                   Bothell
all_desc_text                      70 Residential Lots
longitude                                     -122.224
latitude                                       47.8353
med_z_qac                                       172542
Name: 585, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:43859):
Locations of New Housing A Corelogic Observations (Nobs:3769):
-------------------------------------------------------------------------------
Example 6
CoStar Info:
cbsaname                                         Seattle-Tacoma-Bellevue, WA
countyname                                                              King
z_perhouse                                                            128063
z_perquartac                                                          228285
saleprice_real                                                   9.49331e+06
land_sqft                                                             840708
N_county                                                                  56
N_new                                                                     56
mean_lotsize_county                                                  6109.08
int_margins_sqft_county                                               6.7866
cbsa                                                                   42660
county                                                                 53033
compid                                                               3369471
propertyaddress                                              6135 S 300th St
buyertruecompany                                       M.D.C. Holdings, Inc.
sellertruecompany                                American Classic Homes, LLC
propertycity                                                          Auburn
all_desc_text              This site is for the future Calla Crest Single...
longitude                                                           -122.259
latitude                                                             47.3313
med_z_qac                                                             172542
Name: 579, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:163533):
Locations of New Housing A Corelogic Observations (Nobs:20846):
-------------------------------------------------------------------------------
CBSA: Los Angeles-Long Beach-Anaheim, CA, 6 Central Obs with N Comment
Example 1
CoStar Info:
cbsaname                            Los Angeles-Long Beach-Anaheim, CA
countyname                                                      Orange
z_perhouse                                                      108484
z_perquartac                                                    155264
saleprice_real                                                  715000
land_sqft                                                        32670
N_county                                                             3
N_new                                                                3
mean_lotsize_county                                            7608.95
int_margins_sqft_county                                        18.5579
cbsa                                                             31080
county                                                            6059
compid                                                         4191160
propertyaddress                                        843 N Euclid St
buyertruecompany                                                      
sellertruecompany                                                     
propertycity                                                 Fullerton
all_desc_text               3/4 Acre in Fullerton, build up to 3 SFR's
longitude                                                     -117.943
latitude                                                       33.8793
med_z_qac                                                       157958
Name: 173, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:32313):
Locations of New Housing A Corelogic Observations (Nobs:0):
No Points to Plot
-------------------------------------------------------------------------------
Example 2
CoStar Info:
cbsaname                                  Los Angeles-Long Beach-Anaheim, CA
countyname                                                       Los Angeles
z_perhouse                                                           54126.9
z_perquartac                                                         77466.9
saleprice_real                                                   1.25385e+06
land_sqft                                                              12632
N_county                                                                   7
N_new                                                                      7
mean_lotsize_county                                                  7608.95
int_margins_sqft_county                                              16.4273
cbsa                                                                   31080
county                                                                  6037
compid                                                               3141465
propertyaddress                                                    Scarff St
buyertruecompany                                         Alex H S & Yu W Liu
sellertruecompany                                   MGI Financial Group, Inc
propertycity                                                     Los Angeles
all_desc_text              Seven townhome units to be built reported by s...
longitude                                                            -118.28
latitude                                                             34.0328
med_z_qac                                                             157958
Name: 169, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:116096):
Locations of New Housing A Corelogic Observations (Nobs:1143):
-------------------------------------------------------------------------------
Example 3
CoStar Info:
cbsaname                   Los Angeles-Long Beach-Anaheim, CA
countyname                                        Los Angeles
z_perhouse                                            30705.5
z_perquartac                                            43946
saleprice_real                                         700650
land_sqft                                              111949
N_county                                                  4.5
N_new                                                     4.5
mean_lotsize_county                                   7608.95
int_margins_sqft_county                               16.4273
cbsa                                                    31080
county                                                   6037
compid                                                2802675
propertyaddress                            9971 Foothill Blvd
buyertruecompany                                             
sellertruecompany                  Adachi America Corporation
propertycity                                           Sylmar
all_desc_text                             Future 4-5 SFR Site
longitude                                            -118.345
latitude                                              34.2739
med_z_qac                                              157958
Name: 156, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:116096):
Locations of New Housing A Corelogic Observations (Nobs:1143):
-------------------------------------------------------------------------------
Example 4
CoStar Info:
cbsaname                                  Los Angeles-Long Beach-Anaheim, CA
countyname                                                       Los Angeles
z_perhouse                                                           23219.9
z_perquartac                                                         33232.5
saleprice_real                                                   1.18572e+06
land_sqft                                                            5060365
N_county                                                                   8
N_new                                                                      8
mean_lotsize_county                                                  7608.95
int_margins_sqft_county                                              16.4273
cbsa                                                                   31080
county                                                                  6037
compid                                                               2784798
propertyaddress                                        Big Tujunga Canyon Rd
buyertruecompany                                   Salisbury Development Co.
sellertruecompany                                                Cathay Bank
propertycity                                                         Tujunga
all_desc_text              Property is un-entitled and in a raw condition...
longitude                                                           -118.289
latitude                                                             34.2846
med_z_qac                                                             157958
Name: 163, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:116096):
Locations of New Housing A Corelogic Observations (Nobs:1143):
-------------------------------------------------------------------------------
Example 5
CoStar Info:
cbsaname                   Los Angeles-Long Beach-Anaheim, CA
countyname                                        Los Angeles
z_perhouse                                            18755.4
z_perquartac                                          26842.9
saleprice_real                                       1.15e+06
land_sqft                                               16091
N_county                                                    8
N_new                                                       8
mean_lotsize_county                                   7608.95
int_margins_sqft_county                               16.4273
cbsa                                                    31080
county                                                   6037
compid                                                4542417
propertyaddress                          3849 W Don Tomaso St
buyertruecompany                          3253 Club Drive LLC
sellertruecompany                                            
propertycity                                      Los Angeles
all_desc_text                 Small Lot Subdivision - 8 Homes
longitude                                            -118.341
latitude                                              34.0062
med_z_qac                                              157958
Name: 176, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:116096):
Locations of New Housing A Corelogic Observations (Nobs:1143):
-------------------------------------------------------------------------------
Example 6
CoStar Info:
cbsaname                   Los Angeles-Long Beach-Anaheim, CA
countyname                                             Orange
z_perhouse                                             202960
z_perquartac                                           290478
saleprice_real                                    1.03171e+07
land_sqft                                              133531
N_county                                                   31
N_new                                                      31
mean_lotsize_county                                   7608.95
int_margins_sqft_county                               18.5579
cbsa                                                    31080
county                                                   6059
compid                                                3413074
propertyaddress                                   Valencia Dr
buyertruecompany                       Standard Pacific Corp.
sellertruecompany          Chevron Land & Development Company
propertycity                                             Brea
all_desc_text                Bluetopped SFR Lots for 31 units
longitude                                             -117.85
latitude                                              33.9109
med_z_qac                                              157958
Name: 168, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:32313):
Locations of New Housing A Corelogic Observations (Nobs:0):
No Points to Plot
-------------------------------------------------------------------------------
CBSA: New York-Newark-Jersey City, NY-NJ-PA, 6 Central Obs with N Comment
Example 1
CoStar Info:
cbsaname                   New York-Newark-Jersey City, NY-NJ-PA
countyname                                                Bergen
z_perhouse                                                108215
z_perquartac                                               81632
saleprice_real                                       2.81697e+06
land_sqft                                                 108899
N_county                                                      16
N_new                                                         16
mean_lotsize_county                                      14436.3
int_margins_sqft_county                                  4.69966
cbsa                                                       35620
county                                                     34003
compid                                                   3929502
propertyaddress                                     Roosevelt Dr
buyertruecompany                            Fidelco Realty Group
sellertruecompany                           Somerset Development
propertycity                                          Wood Ridge
all_desc_text                                            16 Lots
longitude                                               -74.0883
latitude                                                 40.8593
med_z_qac                                                 158655
Name: 193, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:51446):
Locations of New Housing A Corelogic Observations (Nobs:1261):
-------------------------------------------------------------------------------
Example 2
CoStar Info:
cbsaname                               New York-Newark-Jersey City, NY-NJ-PA
countyname                                                          Monmouth
z_perhouse                                                           61634.8
z_perquartac                                                         42062.3
saleprice_real                                                        839970
land_sqft                                                             119790
N_county                                                                   8
N_new                                                                      8
mean_lotsize_county                                                  15957.4
int_margins_sqft_county                                              2.71733
cbsa                                                                   35620
county                                                                 34025
compid                                                               3903250
propertyaddress                                              12 Hop Brook Ln
buyertruecompany                                                            
sellertruecompany                                                           
propertycity                                                         Holmdel
all_desc_text              Property Description: 8 Single Family Homes Si...
longitude                                                           -74.1803
latitude                                                             40.3527
med_z_qac                                                             158655
Name: 194, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:23450):
Locations of New Housing A Corelogic Observations (Nobs:840):
-------------------------------------------------------------------------------
CBSA: Dallas-Fort Worth-Arlington, TX, 6 Central Obs with N Comment
Example 1
CoStar Info:
cbsaname                                     Dallas-Fort Worth-Arlington, TX
countyname                                                           Tarrant
z_perhouse                                                          -18989.6
z_perquartac                                                        -21364.3
saleprice_real                                                        105637
land_sqft                                                              40075
N_county                                                                  14
N_new                                                                     14
mean_lotsize_county                                                  9679.53
int_margins_sqft_county                                              2.74136
cbsa                                                                   19100
county                                                                 48439
compid                                                               2731706
propertyaddress                                             2342 Kingsway Dr
buyertruecompany                                                Nephserv Llc
sellertruecompany                                        Dodson Capital, LLC
propertycity                                                       Arlington
all_desc_text              14 Developed town home or duplex lots. The ave...
longitude                                                           -97.1477
latitude                                                             32.7384
med_z_qac                                                           -1585.92
Name: 84, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:84150):
Locations of New Housing A Corelogic Observations (Nobs:9373):
-------------------------------------------------------------------------------
Example 2
CoStar Info:
cbsaname                   Dallas-Fort Worth-Arlington, TX
countyname                                         Tarrant
z_perhouse                                           91112
z_perquartac                                        102506
saleprice_real                                       2e+06
land_sqft                                           203425
N_county                                                17
N_new                                                   17
mean_lotsize_county                                9679.53
int_margins_sqft_county                            2.74136
cbsa                                                 19100
county                                               48439
compid                                             4527545
propertyaddress                           1251 N Park Blvd
buyertruecompany                              Farrukh Azim
sellertruecompany                    Silverlake Properties
propertycity                                     Grapevine
all_desc_text                          Park Blvd - 17 lots
longitude                                         -97.0996
latitude                                           32.9505
med_z_qac                                         -1585.92
Name: 83, dtype: object
-------------------
Location of CoStar Sale:
Locations of Hedonic q Corelogic Observations (Nobs:84150):
Locations of New Housing A Corelogic Observations (Nobs:9373):
-------------------------------------------------------------------------------